#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <vector>
#include <stack>
#include <map>
#include <queue>
#include <set>
using namespace std;
class Solution
{
public:
    const int inf = 0x7fffffff;
    int maxval(map<int, int> &hash)
    {
        int ans = 0, cnt = -inf;
        for (auto &it : hash)
        {
            if (cnt < it.second)
            {
                ans = it.first;
                cnt = it.second;
            }
        }
        return ans;
    }
    int minval(map<int, int> &hash)
    {
        int ans = 0, cnt = inf;
        for (auto &it : hash)
        {
            if (cnt > it.second)
            {
                ans = it.first;
                cnt = it.second;
            }
        }
        return ans;
    }
    int longestSubarray(vector<int> &nums, int limit)
    {
        map<int, int> hash;
        int i = 0, j = 0, ans = 0;
        while (j < nums.size())
        {
            hash[nums[j++]]++;
            
        }
    }
};